﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Telerik.WinControls;
using Telerik.WinControls.Data;
using Telerik.WinControls.UI;

namespace clsEmployeeList.Forms
{
    public partial class frmDBLocationsAccess : Telerik.WinControls.UI.RadForm
    {
        private int intXCoordinate = 0;
        private int intYCoordinate = 0;

        public frmDBLocationsAccess()
        {
            InitializeComponent();
        }

        private void radMultiColumnComboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        public void set_NewLocation(int intX, int intY)
        {
            intXCoordinate = intX;
            intYCoordinate = intY;
        }

        private void frmDBLocationsAccess_Load(object sender, EventArgs e)
        {
            this.TopMost = true;
            //GridViewDataRowInfo rowInfo = new GridViewDataRowInfo(this.dgvLocations.MasterView);

            this.Location = new Point(intXCoordinate, intYCoordinate);

            //for (int inti = 0; inti < 5; inti++)
            //{
            //    rowInfo = new GridViewDataRowInfo(this.dgvLocations.MasterView);
            //    rowInfo.Cells[0].Value = false;  
            //    rowInfo.Cells[1].Value = "Test " + inti;
            //    dgvLocations.Rows.Add(rowInfo);
               
            //}
        }

        public void set_SetTypeAccessOrLevel(string strType)
        {
            try
            {
                GridViewDataRowInfo rowInfo = new GridViewDataRowInfo(this.dgvLocations.MasterView);
                if (dgvLocations.Rows.Count > 0)
                {
                    dgvLocations.Rows.Clear();
                }
                if (strType == "Access")
                {
                    for (int inti = 0; inti < 5; inti++)
                    {
                        rowInfo = new GridViewDataRowInfo(this.dgvLocations.MasterView);
                        rowInfo.Cells[0].Value = false;
                        rowInfo.Cells[1].Value = "Test " + inti + 1;
                        dgvLocations.Rows.Add(rowInfo);
                    }
                }
                else if (strType == "Level")
                {
                    for (int inti = 0; inti < 5; inti++)
                    {
                        rowInfo = new GridViewDataRowInfo(this.dgvLocations.MasterView);
                        rowInfo.Cells[0].Value = false;
                        rowInfo.Cells[1].Value = "Level " + inti + 1;
                        dgvLocations.Rows.Add(rowInfo);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " libEmployeeList_frmDBLocationsAccess_SetTypeAccessOrLevel");
            }
        }

        private void radButton1_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
        }

        private void radButton2_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel; 
        }
    }
}
